﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Win104.IEC104
{
    public class ByteBody
    {
        public byte[] Data;
        public int Index;
        public ByteBody(byte[] data)
        {
            this.Data = data;
            Index = 0;
        }

        public byte GetByte()
        {
            byte b = Data[Index];
            Index += 1;
            return b;
        }

        public byte[] GetBytes(int length)
        {
            byte[] val = Data.Skip(Index).Take(length).ToArray();
            Index += length;
            return val;
        }

    }
}
